{extend name="public:base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-btn-group">
            <a href="{:url('admin/database/backup')}" class="layui-btn ajax-batch"><i class="fa fa-tags"></i> 立即备份</a>
            <a href="{:url('admin/database/optimize')}" class="layui-btn layui-btn-normal ajax-batch"><i class="fa fa-rocket"></i> 批量优化</a>
            <a href="{:url('admin/database/repair')}" class="layui-btn layui-btn-normal ajax-batch"><i class="fa fa-retweet"></i> 批量修复</a>
            <a href="{:url('admin/database/import')}" class="layui-btn layui-btn-primary"><i class="fa fa-database"></i> 数据列表</a>
        </div>
        <table class="layui-table layui-form">
            <thead>
                <tr>
                    <th width="20"><input type="checkbox" lay-skin="primary" lay-filter="*" checked="chedked"></th>
                    <th>表名</th>
                    <th>类型</th>
                    <th>记录</th>
                    <th>大小</th>
                    <th>备注</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {foreach name="list" item="v" empty="$empty"}
                <tr>
                    <td><input type="checkbox" name="table" value="{$v.name}" lay-skin="primary" checked="chedked"></td>
                    <td>{$v.name}</td>
                    <td>{$v.engine}</td>
                    <td>{$v.rows}</td>
                    <td>{$v.data_length|format_bytes}</td>
                    <td>{$v.comment}</td>
                    <td>{$v.create_time}</td>
                    <td>
                        <a href="{:url('admin/database/optimize', ['table' => $v.name])}" class="layui-btn layui-btn-xs layui-btn-normal ajax-action"><i class="fa fa-rocket"></i> 优化</a>
                        <a href="{:url('admin/database/repair', ['table' => $v.name])}" class="layui-btn layui-btn-xs layui-btn-normal ajax-action"><i class="fa fa-retweet"></i> 修复</a>
                    </td>
                </tr>
                {/foreach}
            </tbody>
        </table>
    </div>
</div>
{/block}
